from typing import List, Optional

from pydantic import BaseModel, Field, RootModel


class Message(BaseModel):
    role: str = Field(
        ..., description="The role of the message sender, e.g., 'user' or 'assistant'"
    )
    content: str = Field(..., description="The content of the message")
    name: Optional[str] = Field(
        None, description="Optional name of the assistant, if applicable"
    )


class Messages(RootModel):
    root: List[Message] = Field(
        ..., description="The list of messages in the conversation"
    )


class CalculationParams(BaseModel):
    pass